<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Search Basic Products</title>
</h:head>
<h:body>
<p:panel>
	<h:link outcome = "bookings" value = "Return To The Package!"/>
</p:panel> 
    	 
	<h:form id="form2">
	
 		<p:dataTable  var="transport" value="#{transportSearch.traUser}" 
 				filteredValue="#{transportSearch.filteredUser}"
 				rowKey="#{transport.id}" paginator="true"  
                
                id="transportsTable"
                emptyMessage="There are NO Transports"
                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="5,10,15"
				
				cellSeparator="true"
				resizableColumns="true">  
    

      	<p:column headerText="From" sortBy="fromPlace" filterBy="fromPlace" id="fromPlace">  
            #{transport.fromPlace}
        </p:column> 
        
        <p:column headerText="To" sortBy="toPlace" filterBy="toPlace" id="toPlace">  
            #{transport.toPlace}
        </p:column>  

      	<p:column headerText="Departure Date" sortBy="departureDate" filterBy="departureDate" id="departureDate">  
            #{transport.departureDate}
        </p:column>   

      	<p:column headerText="Passengers" sortBy="passengers" filterBy="passengers" id="passengers">  
            #{transport.passengers}
        </p:column>

      	<p:column headerText="Type" sortBy="type" filterBy="type" id="type">  
            #{transport.type}
        </p:column>
        
        <p:column headerText="Price" sortBy="price" filterBy="price" id="price">  
            #{transport.price}
        </p:column>

   		<p:column style="width:32px">  
             <p:commandButton update=":dlgForm2:transDetGrid" oncomplete="transDialog.show()"  
                     image="ui-icon ui-icon-search" style="width:32px"> 
                 <f:setPropertyActionListener value="#{transport}"  
                     target="#{transportSearch.currentTransport}" />  
             </p:commandButton>  
         </p:column> 
      	<p:column style="width:32px">
	         <p:commandButton style="width:32px" icon="ui-icon-disk"
	           		onmouseover="Add to Package As Departure" 
	      			 action="#{transportSearch.changeDeparture()}"  ajax="false" update=":form2:transportsTable">
	               <f:setPropertyActionListener value="#{transport}"  
	                     target="#{transportSearch.currentTransport}" />  
	          </p:commandButton>
	  	 </p:column>
	                   	
	   	<p:column style="width:32px">
	         <p:commandButton style="width:32px" icon="ui-icon-disk"
	         		onmouseover="Add to Package As Return" 
	 	    		 action="#{transportSearch.changeReturn()}"  ajax="false" update=":form2:transportsTable">
	               <f:setPropertyActionListener value="#{transport}"  
	                target="#{transportSearch.currentTransport}" />  
	          </p:commandButton>
         </p:column>
        
        
   </p:dataTable>
  
 </h:form>
   
  	<p:dialog id="transDialog" header="Details" widgetVar="transDialog" resizable="true"  
              width="600" height="340" dynamic="true" showEffect="exlpode" hideEffect="explode" closeOnEscape="true">  
       		 <h:form id="dlgForm2">
         <h:panelGrid id="transDetGrid" columns="2" cellpadding="4">  
  
        	   								
					<h:outputLabel>Available*:</h:outputLabel>
					<p:selectBooleanCheckbox  
					value="#{transportSearch.currentTransport.available}" disabled="true"/>
					
	
					<h:outputLabel>Disponibility*:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.disponibility}" />
	
					<h:outputLabel>Price*:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.price}" />
					

					<h:outputLabel>Transport Type*:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.type}" />
				
		
					<h:outputLabel>Number of Passengers*:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.passengers}" />

					<h:outputLabel>Class*:</h:outputLabel>
					<h:outputText id="classNumber" value="#{transportSearch.currentTransport.classNumber}"/>
	
					<h:outputLabel>From (Place)*:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.fromPlace}" />
	
					<h:outputLabel>To (Place)*:</h:outputLabel>
					<h:outputText  value="#{transportSearch.currentTransport.toPlace}" />
	
					<h:outputLabel>Departure Date*:</h:outputLabel>
					<p:calendar value="#{transportSearch.currentTransport.departureDate}" disabled="true"  id="departureDate"/>
				
	
					<h:outputLabel>Departure Time*:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.departureTime}"  pattern="HH:mm" timeOnly="true" />					
					
					<h:outputLabel>Departure Company:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.company}" />
					
					<h:outputLabel>Flight ID:</h:outputLabel>
					<h:outputText value="#{transportSearch.currentTransport.flightId}" />
            
		
        </h:panelGrid> 
        
		</h:form>
		
	</p:dialog>
    
 
       	
  
</h:body>

</html>